<template>
<div class="commonBox5 pad15 left10">
    <p>
        <span class="tit2">来往人次</span>
    </p>
    <div ref="chart3" class='top20' style="width: 100%; height: 300px" />
</div>
</template>

<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
export default {
    components: {},
    props: {},
    data() {
        return {
            chartData: {
                data1: ['上午', '下午'],
                data2: ['星期一', '星期二', '星期三', '星期四', '星期五', '星期六'],
                data3: [80, 70, 45, 56, 77, 44],
                data4: [10, 30, 55, 66, 77, 70],
                color: ['#207FFA', '#F8D347']
            }
        }
    },
    computed: {},
    watch: {

    },
    created() {
        const t = this;

    },
    mounted() {
        const t = this;
        t.initChart();
    },
    methods: {
        initChart() {
            this.chart = echarts.init(this.$refs.chart3, 'macarons')
            this.setOptions()
        },
        setOptions() {
            const t = this;
            this.chart.setOption({
                color: t.chartData.color,
                tooltip: {
                    trigger: 'axis'
                },
                legend: {
                    data: t.chartData.data1
                },
                grid: {
                    left: '3%',
                    right: '4%',
                    bottom: '3%',
                    containLabel: true
                },
                xAxis: {
                    type: 'category',
                    boundaryGap: false,
                    data: t.chartData.data2
                },
                yAxis: {
                    type: 'value'
                },
                series: [{
                        name: t.chartData.data1[0],
                        type: 'line',
                        stack: '总量',
                        data: t.chartData.data3
                    },
                    {
                        name: t.chartData.data1[1],
                        type: 'line',
                        stack: '总量',
                        data: t.chartData.data4
                    },
                    
                ]
            })
        }
    }
}
</script>

<style lang="scss" scoped>
</style>
